package com.tc.vo;

import com.tc.domain.Insured_person;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * <p>
 * 被保险人视图对象
 * </p>
 *
 * @author tc
 * @since 2025-07-10
 */
@Data
@ApiModel(value = "Insured_personVO对象", description = "被保险人视图对象")
public class Insured_personVO {
    
    @ApiModelProperty(value = "主键id")
    private Long patientId;

    @ApiModelProperty(value = "姓名")
    private String name;

    @ApiModelProperty(value = "身份证号")
    private String idCard;

    @ApiModelProperty(value = "住院号")
    private String hospitalNumber;

    @ApiModelProperty(value = "性别（男/女）")
    private String gender;

    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ApiModelProperty(value = "出生日期")
    private LocalDateTime birthDate;

    @ApiModelProperty(value = "支付类型（自费/医保）")
    private String paymentType;

    @ApiModelProperty(value = "医保人员类型（在职/退休）")
    private String personCategory;
    
    @ApiModelProperty(value = "医院等级（三级/二级/一级）")
    private String hospitalLevel;

    @ApiModelProperty(value ="家庭住址")
    private String address;

    @ApiModelProperty(value = "创建时间，入院时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;
    
    /**
     * 将实体对象转换为视图对象
     * @param insuredPerson 实体对象
     * @return 视图对象
     */
    public static Insured_personVO fromEntity(Insured_person insuredPerson) {
        if (insuredPerson == null) {
            return null;
        }
        
        Insured_personVO vo = new Insured_personVO();
        vo.setPatientId(insuredPerson.getPatientId());
        vo.setName(insuredPerson.getName());
        vo.setIdCard(insuredPerson.getIdCard());
        vo.setHospitalNumber(insuredPerson.getHospitalNumber());
        vo.setGender(insuredPerson.getGender());
        vo.setAge(insuredPerson.getAge());
        vo.setBirthDate(insuredPerson.getBirthDate());
        vo.setPaymentType(insuredPerson.getPaymentType());
        vo.setPersonCategory(insuredPerson.getPersonCategory());
        vo.setHospitalLevel(insuredPerson.getHospitalLevel());
        vo.setAddress(insuredPerson.getAddress());
        vo.setCreateTime(insuredPerson.getCreateTime());
        vo.setUpdateTime(insuredPerson.getUpdateTime());
        
        return vo;
    }
}
